package com.shr.didi;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String arrayLine = sc.nextLine();	
		String[] strArray = arrayLine.split(" ");
		int[] array = new int[strArray.length];
		for(int i = 0;i<strArray.length;i++){
			array[i] = Integer.parseInt(strArray[i]) ;
		}
		
		int curSum = 0;
		int maxSum = Integer.MIN_VALUE;
		for(int i = 0;i<array.length;i++){
			if(curSum <= 0)
				curSum = array[i] ;
			else curSum += array[i] ;
			maxSum = Math.max(curSum, maxSum);
		}
		System.out.println(maxSum);
		sc.close();
	}
	
}
